package com.snow.campuslink.courier.service.impl;

import com.snow.campuslink.courier.entity.Courier;
import com.snow.campuslink.courier.mapper.CourierMapper;
import com.snow.campuslink.courier.service.ICourierService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snow.campuslink.utils.RedisUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Gaosl
 * @since 2021-03-17
 */
@Service
public class CourierServiceImpl extends ServiceImpl<CourierMapper, Courier> implements ICourierService {

    @Resource
    RedisUtil redisUtil;

    @Override
    public void start(Long courierId) {
        redisUtil.sAdd("courier:start:set:key",courierId.toString());
    }

    @Override
    public void close(Long courierId) {
        redisUtil.sRemove("courier:start:set:key",courierId.toString());
    }
}
